package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.iwhalecloud.bss.kite.common.constant.KeyConsts;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.GlowedNodeInterconnectionIpServiceAttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.api.IQuerySceneInstService;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.scene.attr.OperateInstAttrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @author zhoubang
 * 云聚节点-云联网专线接入产品-新版-是否互联IP地址客户提供属性联动
 */
@Service
@AttrHandler(GlowedNodeInterconnectionIpServiceAttrHandler.class)
public class GlowedNodeInterconnectionIpServiceAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {
    @Autowired
    IQuerySceneInstService querySceneInstService;

    @Autowired
    OperateInstAttrService operateInstAttrService;

    @Override
    public void handle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData data) {
        if(KiteStringUtils.equals(kiteAttr.getValue(), "1_0000106")){
            kiteInst.getAttr("2_0000047").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_M);
            kiteInst.getAttr("200001761").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_M);
            kiteInst.getAttr("200001762").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_M);
        }else {
            kiteInst.getAttr("2_0000047").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_H);
            kiteInst.getAttr("200001761").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_H);
            kiteInst.getAttr("200001762").setShowType(KeyConsts.PROD_ATTR_SHOW_TYPE_H);
        }
    }

    @Override
    public void handleStyle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData data) {

    }
}
